package org.example.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class AsyncThread extends Thread{

    @Override
    public void run() {
        System.out.println("current thread name :"+Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        AsyncThread asyncThread = new AsyncThread();
        asyncThread.run();
    }

    ExecutorService executorService = Executors.newCachedThreadPool();
    public void fun(){
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("执行业务逻辑。。。");
            }
        });
    }
}
